package com.henghai.zhenxuan.data.api;

import androidx.annotation.NonNull;

import com.blankj.utilcode.util.AppUtils;
import com.hjq.http.config.IRequestApi;
import com.hjq.http.config.IRequestType;
import com.hjq.http.model.BodyType;

public final class LoginApi implements IRequestApi, IRequestType {

    private String username;
    private String password;
    private String currVersion;
    private String code;
    private String uuid;
    private String packageName;
    private String phoneSha1;

    public LoginApi(String username, String password,String packageName,String phoneSha1) {
        this.username = username;
        this.password = password;
        this.packageName = packageName;
        this.phoneSha1 = phoneSha1;
        this.currVersion = AppUtils.getAppVersionCode() + "";
    }

    /**
     * 请求接口
     */
    @NonNull
    @Override
    public String getApi() {
        return "/appLogin";
    }


    @NonNull
    @Override
    public BodyType getBodyType() {
        return BodyType.JSON;
    }

    @Override
    public String toString() {
        return "LoginApi{" +
                "username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", currVersion='" + currVersion + '\'' +
                ", code='" + code + '\'' +
                ", uuid='" + uuid + '\'' +
                ", packageName='" + packageName + '\'' +
                ", phoneSha1='" + phoneSha1 + '\'' +
                '}';
    }
}
